var app = getApp();
var util = require("../../utils/util.js");
var siteinfo = require('../../siteinfo.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    description:''
  },

  onLoad: function (options) {
    this.getDetail(options.id);
  },

  onShow: function () {

  },
  //复制链接
  copy: function (e) {
    wx.setClipboardData({
      data: e.currentTarget.dataset.url,
      success(res) {
        wx.getClipboardData({
          success(res) { }
        })
      }
    })
  },
   // 获取详情信息
  getDetail: function (id) {
    var _this = this
    app._get(siteinfo.selNewsDetail, {
      id: id
    }, function (result) {
      _this.setData({
        description: result.data
      });
      if (result.data.files != '' && result.data.files !=null){
        _this.setData({
          files: util.subFileName(result.data.files)
        });
      }
    })
  },

  onShareAppMessage: function () {

  }
})